define(['jquery', 'bootstrap', 'swiper'], function($){
    return {
      init: function(data) {
        this.initPage();
      },
  
      initPage: function() { 
        var mySwiper = new Swiper('.swiper-container',{
          prevButton:'.swiper-button-prev',
          nextButton:'.swiper-button-next',
          slidesPerView : 3,
          spaceBetween : 20,
        })

        $(".guide-layout .col-xs-3 .item").on("mouseover", function(e) {        
          $(".guide-description .item").hide();
          var id = $(e.currentTarget).parent().index()
          $(".guide-description-" + (id+1)).show();
        })



        $(".submit").on("click", function() {
          var name=$("[name='name']").val(),
          address=$("[name='address']").val(),
          days = $("[name='date']").val(),
          mobile=$("[name='mobile']").val(),
          message=$("[name='message']").val(),
          body="姓名: "+name+"%0a%0d"
          +"目的地: "+address+"%0a%0d"
          +"天数: "+days+"%0a%0d"
          +"联系方式: "+mobile+"%0a%0d"
          +"备注:"+"%0a%0d"+message;
          $(".send").attr("href","mailto:shainfo@chinaholidaytours.com?body="+body);
          $(".send")[0].click()
        })


        $(document).on("mouseover", ".qrcode-layout", function() {
          $(".qrcode").show();
          setTimeout(function() {
            $(".qrcode").hide();
          }, 60000)
        })
      }
    }
  })